import request from '@/utils/request'

// 查询指数信息列表
export function getIndexInfoList(query) {
    return request({
        url: '/index/queryIndexInfoByPage.action',
        method: 'get',
        params: query
    })
}

// 查询指数成分列表
export function getIndexCompList(query) {
    return request({
        url: '/index/queryIndexCompInfoByPage.action',
        method: 'get',
        params: query
    })
}

// 查询指数行情列表
export function getIndexPriceList(query) {
    return request({
        url: '/index/queryIndexPriceInfoByPage.action',
        method: 'get',
        params: query
    })
}

// 查询指数行情曲线
export function getIndexPriceCurve(query) {
    return request({
        url: '/index/queryIndexPriceCurve.action',
        method: 'get',
        params: query
    })
}

// 新增指数信息
export function addIndexInfo(data) {
    return request({
        url: '/index/insertIndexInfo.action',
        method: 'post',
        data: data
    })
}

// 修改指数信息
export function updateIndexInfo(data) {
    return request({
        url: '/index/updateIndexInfo.action',
        method: 'put',
        data: data
    })
}

// 删除指数信息
export function delIndexInfo(data) {
    return request({
        url: '/index/deleteIndexInfo.action',
        method: 'delete',
        data: data
    })
}

// 新增指数行情
export function addIndexPrice(data) {
    return request({
        url: '/index/insertIndexPrice.action',
        method: 'post',
        data: data
    })
}

// 修改指数行情
export function updateIndexPrice(data) {
    return request({
        url: '/index/updateIndexPrice.action',
        method: 'put',
        data: data
    })
}

// 删除指数行情
export function delIndexPrice(data) {
    return request({
        url: '/index/deleteIndexPrice.action',
        method: 'delete',
        data: data
    })
}


// 新增指数成分
export function addIndexComp(data) {
    return request({
      url: '/index/insertIndexComp.action',
      method: 'post',
      data: data
    })
  }
  
  // 修改指数成分
  export function updateIndexComp(data) {
    return request({
      url: '/index/updateIndexComp.action',
      method: 'put',
      data: data
    })
  }
  
  // 删除指数成分
  export function delIndexComp(data) {
    return request({
      url: '/index/deleteIndexComp.action',
      method: 'delete',
      data: data
    })
  }
